package com.aiyige.model;

import android.os.Parcel;
import android.os.Parcelable;

import com.aiyige.model.moment.backup.DetailBackup;
import com.aiyige.model.moment.backup.MomentOnsaleBackup;
import com.aiyige.model.tag.Tag;

import java.util.ArrayList;
import java.util.List;

/**
 * 购买时候生成的镜像
 * Created by xiachao on 2018/4/16.
 */

public class AgreementBackup implements Parcelable {
    String id;
    String summary;
    String creator;
    DetailBackup detailBackup;
    String moreBackup;
    String subject;
    String channel;
    String cityId;
    String title;
    long processTime;
    List<Tag> tags;
    List<String> cover;
    String router;
    String orginId;
    String categoryId;
    String status;
    MomentOnsaleBackup onsalesBackup;

    public String getId() {
        return id == null ? "" : id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getSummary() {
        return summary == null ? "" : summary;
    }

    public void setSummary(String summary) {
        this.summary = summary;
    }

    public String getCreator() {
        return creator == null ? "" : creator;
    }

    public void setCreator(String creator) {
        this.creator = creator;
    }

    public DetailBackup getDetailBackup() {
        return detailBackup;
    }

    public void setDetailBackup(DetailBackup detailBackup) {
        this.detailBackup = detailBackup;
    }

    public String getMoreBackup() {
        return moreBackup == null ? "" : moreBackup;
    }

    public void setMoreBackup(String moreBackup) {
        this.moreBackup = moreBackup;
    }

    public String getSubject() {
        return subject == null ? "" : subject;
    }

    public void setSubject(String subject) {
        this.subject = subject;
    }

    public String getChannel() {
        return channel == null ? "" : channel;
    }

    public void setChannel(String channel) {
        this.channel = channel;
    }

    public String getCityId() {
        return cityId == null ? "" : cityId;
    }

    public void setCityId(String cityId) {
        this.cityId = cityId;
    }

    public String getTitle() {
        return title == null ? "" : title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public long getProcessTime() {
        return processTime;
    }

    public void setProcessTime(long processTime) {
        this.processTime = processTime;
    }

    public List<Tag> getTags() {
        if (tags == null) {
            return new ArrayList<>();
        }
        return tags;
    }

    public void setTags(List<Tag> tags) {
        this.tags = tags;
    }

    public List<String> getCover() {
        if (cover == null) {
            return new ArrayList<>();
        }
        return cover;
    }

    public void setCover(List<String> cover) {
        this.cover = cover;
    }

    public String getRouter() {
        return router == null ? "" : router;
    }

    public void setRouter(String router) {
        this.router = router;
    }

    public String getOrginId() {
        return orginId == null ? "" : orginId;
    }

    public void setOrginId(String orginId) {
        this.orginId = orginId;
    }

    public String getCategoryId() {
        return categoryId == null ? "" : categoryId;
    }

    public void setCategoryId(String categoryId) {
        this.categoryId = categoryId;
    }

    public String getStatus() {
        return status == null ? "" : status;
    }

    public void setStatus(String status) {
        this.status = status;
    }


    public MomentOnsaleBackup getOnsalesBackup() {
        return onsalesBackup;
    }

    public void setOnsalesBackup(MomentOnsaleBackup onsaleBackup) {
        this.onsalesBackup = onsaleBackup;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(this.id);
        dest.writeString(this.summary);
        dest.writeString(this.creator);
        dest.writeParcelable(this.detailBackup, flags);
        dest.writeString(this.moreBackup);
        dest.writeString(this.subject);
        dest.writeString(this.channel);
        dest.writeString(this.cityId);
        dest.writeString(this.title);
        dest.writeLong(this.processTime);
        dest.writeTypedList(this.tags);
        dest.writeStringList(this.cover);
        dest.writeString(this.router);
        dest.writeString(this.orginId);
        dest.writeString(this.categoryId);
        dest.writeString(this.status);
        dest.writeSerializable(this.onsalesBackup);
    }

    public AgreementBackup() {
    }

    protected AgreementBackup(Parcel in) {
        this.id = in.readString();
        this.summary = in.readString();
        this.creator = in.readString();
        this.detailBackup = in.readParcelable(DetailBackup.class.getClassLoader());
        this.moreBackup = in.readString();
        this.subject = in.readString();
        this.channel = in.readString();
        this.cityId = in.readString();
        this.title = in.readString();
        this.processTime = in.readLong();
        this.tags = in.createTypedArrayList(Tag.CREATOR);
        this.cover = in.createStringArrayList();
        this.router = in.readString();
        this.orginId = in.readString();
        this.categoryId = in.readString();
        this.status = in.readString();
        this.onsalesBackup = (MomentOnsaleBackup) in.readSerializable();
    }

    public static final Creator<AgreementBackup> CREATOR = new Creator<AgreementBackup>() {
        @Override
        public AgreementBackup createFromParcel(Parcel source) {
            return new AgreementBackup(source);
        }

        @Override
        public AgreementBackup[] newArray(int size) {
            return new AgreementBackup[size];
        }
    };
}
